<?php

namespace app\common\model;

use think\Model;
use traits\model\SoftDelete;

/**
 * 发票模型
 */
class UserInvoice extends Model
{
    use SoftDelete;

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    protected $deleteTime = 'deletetime';
    // 追加属性
    protected $append = [

    ];


    public function getImagesAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['images']) ? $data['images'] : '');
        if(!$value){ return  [];}
        $value = explode(',',$value);
        foreach ($value as $k=>&$v){
            $v=get_app_image_url($v);
        }
        return $value;
    }
}
